import request from "../../utils/request";

export function getTimeById (query) {
    return request({
        url: '/api/singleTime/'+query,
        method: 'get'
    })
}

export const getSingleTime = query =>{
    return request({
        url: '/api/singleTime/dict',
        method: 'get'
    })
}

export const getWeekday = query =>{
    return request({
        url: '/api/singleTime/dict/weekday',
        method: 'get'
    })
}

export function getTimeByWeekday(query){
    return request({
        url: '/api/singleTime/dict/time/'+query,
        method: 'get'
    })
}

export function deleteByWeekdayAndTime(Weekday,Time){
    return request({
        url: '/api/singleTime/',
        method: 'get',
        params: {Weekday:Weekday,
        Time:Time}
    })
}

export function submitTime(query){
    return request({
        url: '/api/singleTime',
        method: 'post',
        data: query
    })
}

export function getIdByWeekdayAndTime(weekday,time){
    return request({
        url: '/api/singleTime/getIdByWeekdayAndTime/',
        method: 'get',
        params:{
            weekday:weekday,
            time:time
        }
    })
}